#ifndef Task_h__
#define Task_h__

#include <QString>
#include <QJsonObject>
#include <QUuid>
#include <QMetaType>
#include <map>
#include "Session.h"

class Task : public QObject
{
    Q_OBJECT;
public:
    Task(const QString &name, QObject *parent = nullptr);
    void initCurrentDir();
    ~Task();
public:
    // extra methods : 
    const Session *session(){ return &_session; }
    int channel() const { return _session.channel(); }
    void saveImage(const QString &description, const QPixmap & pixmap) const;
signals:
    void finished();
protected:
    virtual QString arg2str() const;
    virtual void start() = 0;
private:
    QDir currentDir() const;
private:
    QString _name;
    QUuid _uid;
    QString _currentDir;
    Session _session;
};

#endif // Task_h__
